<html>
    <head>
        <title>Login</title>
<?php
           require_once 'connection.php';
           session_start();
           $username = $_POST['username'];
           $password = $_POST['password'];
           $md5password = md5($password);
           $result = mysql_query("SELECT * from user where username = '$username'");
           $row = mysql_fetch_array($result);
           if ($row){
                if ($row['password']==$md5password)
                    {
?>
                   <meta HTTP-EQUIV='REFRESH' content='3; url=../anjync-file/home.php'>
                   </head>
                   <body>Log in successful<br /></body>
<?php
                    $_SESSION['username']=$username;
                    }
                else
                    {
?>
                   <meta HTTP-EQUIV='REFRESH' content='3; url=index.php'>
                   </head>
                   <body>Login failed<br /></body>
<?php
                    }
           }
           else
           {
?>
           <meta HTTP-EQUIV='REFRESH' content='3; url=index.php'>
           </head>
           <body>Login failed<br /></body>
<?php       }

?>
</html>
